<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('categories', function (Blueprint $table) {
            //$table->id();
            $table->integer('id', true);
            $table->string('cname');
            $table->string('aliasname')->nullable();
            $table->integer('pid');
            $table->tinyInteger('cdepth')->default(0);
            $table->boolean('haschild')->nullable()->default(false);
            $table->text('cpath')->nullable();
            $table->integer('corders');
            $table->integer('attr')->nullable();
            $table->string('url')->nullable();
            $table->string('list_tmp', 200)->nullable();
            $table->string('detail_tmp', 200)->nullable();
            $table->string('page_tmp', 200)->nullable();
            $table->integer('clicks')->nullable()->default(0);
            $table->boolean('flags')->nullable()->default(false);
            $table->string('title')->nullable();
            $table->longText('img_url')->nullable();
            $table->string('scontent')->nullable();
            $table->text('keyword')->nullable();
            $table->string('description')->nullable();
            $table->boolean('ismenu')->nullable();
            $table->unsignedInteger('is_tree')->nullable()->default('1')->comment('是否作为内容管理模块栏目显示 1 显示 0:不显示');
            $table->integer('auth')->nullable()->default(0);
            $table->integer('num')->nullable();
            $table->integer('ename')->nullable();
            $table->unsignedTinyInteger('isindexnav')->nullable()->default('0');
            $table->unsignedTinyInteger('is_single')->nullable()->default('0')->comment('是否是单页面 0 否 1 是');
            $table->string('template')->nullable()->comment('自定义模版名称');
            $table->unsignedTinyInteger('show_body')->nullable()->default('0')->comment('是否直接显示子分类主体内容一般用于介绍');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('categories');
    }
};
